Skip to content

Integrate server to mongodb#44

Merged
esadakcam merged 1 commit intomainfrom
feature/db-integration
Jun 10, 2025
Merged

Integrate server to mongodb#44
esadakcam merged 1 commit intomainfrom
feature/db-integration

Conversation

@esadakcam
Copy link
Collaborator

No description provided.

@esadakcam esadakcam requested review from Copilot and edkaya June 10, 2025 20:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Integrate the server with MongoDB by parameterizing the connection URI and updating deployment manifests.

  • Parameterize MongoDB URI in application.yaml using MONGO_USERNAME, MONGO_PASSWORD, and MONGO_HOST.
  • Bump MongoDB image version to 8.0 in the Helm chart and Docker Compose.
  • Replace default init environment variables in the Helm chart.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
server/src/main/resources/application.yaml Switched hard-coded MongoDB URI to templated environment values.
recipai-chart/templates/mongodb-deployment.yml Updated MongoDB image to 8.0 and replaced init-user env variables.
docker-compose.dev.yml Changed MongoDB image tag from latest to 8.0.
Comments suppressed due to low confidence (5)

server/src/main/resources/application.yaml:21

  • The MongoDB connection URI contains colons and slashes that may confuse the YAML parser. Wrap the entire URI in quotes (e.g., "mongodb://...") to ensure it’s parsed correctly.
uri: mongodb://${MONGO_USERNAME:admin}:${MONGO_PASSWORD:admin}@${MONGO_HOST:127.0.0.1:27017}/recipai?authSource=admin

recipai-chart/templates/mongodb-deployment.yml:31

  • The official MongoDB image expects MONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD to initialize the database. Replacing them with MONGO_USERNAME and MONGO_PASSWORD will prevent the built-in init script from running correctly. Consider reverting to the expected variable names or adding an init container to handle custom names.
-            - name: MONGO_HOST

recipai-chart/templates/mongodb-deployment.yml:32

  • [nitpick] Embedding the port in MONGO_HOST can be confusing. It may be clearer to define separate MONGO_HOST and MONGO_PORT variables for better clarity and future flexibility.
-            - value: {{ .Values.services.mongodb }}:27017

docker-compose.dev.yml:48

  • [nitpick] Pinning to a minor version tag (8.0) can lead to unexpected patch upgrades. Consider specifying a full patch version (e.g., 8.0.5) to ensure consistent local environments.
image: mongo:8.0

server/src/main/resources/application.yaml:19

  • The new environment variables (MONGO_USERNAME, MONGO_PASSWORD, MONGO_HOST) should be documented in the README or deployment guide, including their defaults and expected formats.
data:

@esadakcam esadakcam merged commit 3d0586a into main Jun 10, 2025
8 checks passed
@esadakcam esadakcam deleted the feature/db-integration branch June 10, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants